package com.rustic.server.enums;

import cn.xy.commons.validator.VerifiedEnum;
import lombok.Getter;

/**
 * 点赞收藏浏览的类型枚举
 */

@Getter
public enum LinkType implements VerifiedEnum {

    /**
     * 乡村
     */
    RUSTIC(1, "乡村"),

    /**
     * 事件活动
     */
    ACTIVITY(2, "事件活动"),

    /**
     * 景点
     */
    ATTRACTIONS(3, "景点"),

    /**
     * 美食
     */
    FOOD(4, "美食"),

    /**
     * 攻略
     */
    TRAVEL_PLAN(5, "攻略");

    private final int value;

    private final String name;

    LinkType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public static LinkType toLinkType(int value) {
        for (LinkType category : LinkType.values()) {
            if (category.getValue() == value) {
                return category;
            }
        }
        throw new IllegalArgumentException("Invalid Category Value: " + value);
    }


    @Override
    public Object getVerifiedValue() {
        return this.value;
    }
}
